#!/bin/sh

if [ "$1" = "autoconf" ]; then
	echo 'yes'
	exit 0
fi

if [ "$1" = "config" ]; then
	cat <<EOF
graph_title Memory Utilization
graph_category memory
graph_vlabel byte
graph_args --base 1024 -l 0
graph_info Memory utilization
rss.label rss
rss.draw AREA
physcap.label cap
physcap.draw LINE1
EOF
	exit 0
fi

kstat -p memory_cap:*:*:physcap kstat -p memory_cap:*:*:rss | sed 's/.*://g' | awk '{ print $1 ".value", $2 }'
